package com.piece.blog.model;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.Type;

import javax.persistence.*;
import java.io.Serializable;

@Data
@Entity
@NoArgsConstructor
@Table(name = "blog_article_info")
@ApiModel(value = "文章详情表:blog_article_info")
public class ArticleInfo implements Serializable {

    @Id
    @Column(name = "info_id", length = 11)
    @ApiModelProperty(value = "主键")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long infoId;

    @Column(name = "article_id", length = 11)
    @ApiModelProperty(value = "文章主键")
    private Long articleId;

    @Column(name = "editor", length = 16)
    @ApiModelProperty(value = "编辑器类型")
    private String editor;

    @Lob
    @Type(type="text")
    @Column(name = "content")
    @ApiModelProperty(value = "文章内容")
    private String content;

    @Lob
    @Type(type="text")
    @Column(name = "html")
    @ApiModelProperty(value = "文章内容编译成html后内容")
    private String html;
}
